package net.hxz.modules.services.impl;

import java.util.List;

import net.hxz.modules.dao.TypeMapper;
import net.hxz.modules.pojo.Type;
import net.hxz.modules.services.ITypeService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("typeService")
public class TypeService implements ITypeService {

	@Autowired
	private TypeMapper typeMapper;	
	@Override
	public List<Type> getByParent(Long typeId) {
		return typeMapper.getByParent(typeId);
	}
	@Override
	public Type get(Long typeId) {
		return typeMapper.get(typeId);
	}
	@Override
	public int countByParent(Long typeId) {
		return typeMapper.countByParent(typeId);
	}
	@Override
	public int add(Type type) {
		return typeMapper.insert(type);
	}
	@Override
	public int del(Long typeId) {
		return typeMapper.delete(typeId);
	}
	@Override
	public int modify(Type type) {
		return typeMapper.update(type);
	}
	@Override
	public List<Type> getWithChildren(long typeId) {
		return typeMapper.getWithChildren(typeId);
	}
	
}
